package com.bwie.controller;

import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/user")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * 用户登录接口
     * @param loginInfoVo
     * @return
     */
    @PostMapping("/userLogin")
    public R userLogin (@RequestBody @Validated LoginInfoVo loginInfoVo) {
        return userService.userLogin(loginInfoVo);
    }

    /**
     * 根据ID查询列表接口
     * @param id
     * @return
     */
    @PostMapping("/userById/{id}")
    public R userById (@PathVariable Integer id) {
        return userService.userById(id);
    }
}
